<?php
   
    var_dump($_POST['ct']);
    $tab = explode('/', $_POST['ct']);
   
    $d = new DateTime();
    $d->setDate($tab[2], $tab[1], $tab[0]);
    $d->setTime($_POST['hour'], $_POST['min'],$_POST['sec'] );
    $d->setTimezone(new DateTimeZone('Europe/Paris'));
    
    
    $message_attente = htmlentities($_POST['message_attente']);
    $message_fin = htmlentities($_POST['message_fin']);

    // Puis on la converti au format mysql
    $date_str = $d->format('Y-m-d h:i:s');
    
    var_dump($date_str);
        
	include 'connexionbdd.php';
     
    $refID = uniqid('');
	
	$rq = "insert into cd(`datevalue`, `waitingtext`, `resulttext`, `ref`) values ('$date_str','$message_attente', '$message_fin', '$refID')";
	mysql_query($rq);
	
		
	header('Location: index.php?ref='.$refID);
	
	?>